# include "EncoderFilter.h"
extern "C" {
#include "libavcodec/packet.h"
}

EncoderFilter::EncoderFilter()
{
}

void EncoderFilter::addFilter(EncoderFilter* _next)
{
	if (this->m_next != nullptr) {
		this->m_next->addFilter(_next);
	}
	else {
		this->m_next = _next;
	}
}

void EncoderFilter::afterVideoSwr(const uint8_t* _data, size_t _size, void* _video_encoder)
{
	if (this->m_next != nullptr) {
		this->m_next->afterVideoSwr(_data, _size, _video_encoder);
	}
}

void EncoderFilter::afterAudioSwr(const uint8_t* _data, size_t _size, void* _audio_encoder)
{
	if (this->m_next != nullptr) {
		this->m_next->afterAudioSwr(_data, _size, _audio_encoder);
	}
}

void EncoderFilter::afterVideoEncode(AVPacket* _packet)
{
	if (this->m_next != nullptr) {
		this->m_next->afterVideoEncode(_packet);
	}
}

void EncoderFilter::afterAudioEncode(AVPacket* _packet)
{
	if (this->m_next != nullptr) {
		this->m_next->afterAudioEncode(_packet);
	}
}

EncoderFilter::~EncoderFilter()
{
	// delete this->m_next;
}
